home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 1.9 KB | 53 lines | [TEXT/CWIE] |
- // ArrayOf.h
-
- #ifndef ArrayOf_h
- #define ArrayOf_h
-
- #ifndef ConstArrayOf_h
- #include "ConstArrayOf.h"
- #endif
-
- template < class Element >
- class ArrayOf: public ConstArrayOf< Element >
- {
- typedef ArrayOf< Element > ArrayType;
- typedef ConstArrayOf< Element > ConstArrayType;
-
- private:
- ArrayOf( ConstArrayType theArrayOf )
- : ConstArrayOf< Element >( theArrayOf )
- {}
-
- public:
- ArrayOf() {}
- ArrayOf( Element *theStart, uint32 theLength )
- : ConstArrayOf< Element >( theStart, theLength )
- {}
-
- Element *Start() const { return const_cast<Element *>( ConstArrayType::Start() ); }
- Element *End() const { return const_cast<Element *>( ConstArrayType::End() ); }
-
- Element& operator[]( uint32 i ) const
- { return const_cast<Element &>( ConstArrayType::operator[]( i ) ); }
-
- ArrayType Head( uint32 position ) const { return ConstArrayType::Head( position ); }
- ArrayType Tail( uint32 position ) const { return ConstArrayType::Tail( position ); }
- ArrayType Middle( URange32 range ) const { return ConstArrayType::Middle( range ); }
-
- void Append( ArrayType tail ) { ConstArrayType::Append( tail ); }
- void Prepend( ArrayType head ) { ConstArrayType::Prepend( head ); }
-
- void operator+=( ArrayType tail ) { ConstArrayType::Append( tail ); }
- ArrayType operator+( ArrayType tail ) { return ConstArrayType::operator+( tail ); }
-
- ArrayType operator&( ConstArrayType r ) const { return ConstArrayType::operator&( r ); }
- void operator|=( ArrayType r ) { ConstArrayType::operator|=( r ); }
- ArrayType operator|( ArrayType r ) const { return ConstArrayType::operator|( r ); }
- ConstArrayType operator|( ConstArrayType r ) const { return ConstArrayType::operator|( r ); }
-
- uint32 operator<<( ConstArrayType r ) const; // returns the amount copied
- uint32 BitwiseCopy( ConstArrayType r ) const;
- };
-
- #endif
-